package com.wish.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wish.dto.RoomReservationDto;
import com.wish.entity.RoomReservation;
import com.wish.entity.SysRegion;
import com.wish.mapper.RoomReservationMapper;
import com.wish.service.IRoomReservationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 预约房源表 服务实现类
 * </p>
 *
 * @author 五组
 * @since 2021-03-29
 */
@Service
public class RoomReservationServiceImpl extends ServiceImpl<RoomReservationMapper, RoomReservation> implements IRoomReservationService {
    @Resource
    private RoomReservationMapper roomReservationMapper;
    @Override
    public List<RoomReservation> selects(RoomReservationDto roomReservationDto) {
        return roomReservationMapper.selects(roomReservationDto);
    }
    @Transactional
    @Override
    public boolean update(Integer status, String[] ids) {
        try {
            for (String id: ids) {
                roomReservationMapper.update(status,id);
            }
            return true;
        }catch (Exception e){
            e.printStackTrace();
            return false;
        }

    }


}
